
# ------------------------------
# 主函数示例
# ------------------------------
import argparse


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Organize photos with CLIP + Open Images labels")
    parser.add_argument("src", type=str, help="Path to source folder containing images")
    parser.add_argument("dst", type=str, help="Path to destination folder for organized images")
    parser.add_argument("--json", type=str, default="bbox_labels_600_hierarchy.json", help="Path to JSON hierarchy file")
    parser.add_argument("--csv", type=str, default="oidv7-class-descriptions.csv", help="Path to CSV class description file")
    parser.add_argument("--recursive", type=bool, default=True, help="Traverse subfolders")

    args = parser.parse_args()

    from classify.config import *
    from classify.classifier import *
    from sorters_main import *
    
    label_manager = LabelManager(args.json, args.csv)
    classifier = ImageClassifier()
    organizer = ImageOrganizer(args.src, args.dst, classifier, label_manager)

    organizer.organize(recursive=args.recursive)
